package com.quanyan.order.exception;

import com.quanyan.common.enums.BaseEnum;

/**
 * @author songzj
 * @date 16/6/13-10:53
 */
public enum OrderExceptionEnum implements BaseEnum {


    ORDER_REFUND_AMOUNT_OVERTOP(21001, "ORDER_REFUND_AMOUNT_OVERTOP", "退款金额超过支付金额", false),
    ORDER_DO_NOT_EXISTS(21002, "ORDER_DO_NOT_EXISTS", "订单号码不存在", false),
    ORDER_STATUS_INVALID(21003, "ORDER_STATUS_INVALID", "订单状态非法", false),
    ORDER_REFUND_REPEAT(21004, "ORDER_REFUND_REPEAT", "用户重复退款", false),
    ORDER_DO_NOT_PAYED(21005, "ORDER_DO_NOT_PAYED", "订单未支付/未确认", false),
    ORDER_HAD_PAYED(21005, "ORDER_HAD_PAYED", "订单已支付", false),
    ORDER_AMOUNT_DIFFRENT(21006, "ORDER_AMOUNT_DIFFRENT", "支付金额不一致", false),
    ORDER_CLOSE(21007, "ORDER_CLOSE", "订单已关闭", false),
    ORDER_REFUND_DO_NOT_EXISTS(21008, "ORDER_REFUND_DO_NOT_EXISTS", "退款记录不存在", false),
    ORDER_AMOUNT_VALID(21008, "ORDER_AMOUNT_VALID", "订单总金额非法", false),
    ORDER_AMOUNT_FORMAT_ERROR(21009, "ORDER_AMOUNT_FORMAT_ERROR", "payId为支付宝、微信类的，amount或refundAmount请保留两位小数。payId为鸟蛋、蛋壳类的，amount或refundAmount应为整数。", false),
    ORDER_NO_NULL(21010, "ORDER_NO_NULL", "订单号不能为空", false),
    NEED_AFRESH_ACCREDIT(21011, "NEED_AFRESH_ACCREDIT", "授权不存在或已过期，需要用户重新授权。", false),
    PAY_WAY_NOT_ENABLED(21012, "PAY_WAY_NOT_ENABLED", "当前支付方式不可用，请使用其他支付方式或稍后再试。", false),
    ;
    private int id;
    private String code;
    private String label;
    private boolean success;

    OrderExceptionEnum(int id, String code, String label, boolean success) {
        this.id = id;
        this.code = code;
        this.label = label;
        this.success = success;
    }

    @Override
    public int getId() {
        return id;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public boolean isSuccess() {
        return success;
    }
}
